//-------------------------------------------------------------------
//	Copyright (c) 2012-2014 Zhirnov Andrey
//	This file is part of the "UXGEN-ES" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#pragma once

#include "UI/Types/Types.h"

namespace Engine
{
namespace UI
{


	//
	// UI Texture
	//

	struct UITexture
	{
		friend struct ::MetaData::UITextureCfg;
		friend class UITextureManager;

	// types
	public:
		typedef Graphics::TexturePtr	TexturePtr;

	// variables
	private:
		TexturePtr	_texture;
		rect		_texcoord;
		uvec2		_dim;
		bool		_inAtlas;
		

	// methods
	public:
		UITexture () : _texcoord(0.0f, 0.0f, 1.0f, 1.0f), _inAtlas(false) {}

		bool				IsLoaded ()		const	{ return _texture.IsNotNull(); }

		bool				CanBeTiled ()	const	{ return not _inAtlas; }

		uvec2 const &		Dimension ()	const	{ return _dim; }

		rect const &		TexCoords ()	const	{ return _texcoord; }

		TexturePtr const &	Texture ()		const	{ return _texture; }
	};


}	// UI
}	// Engine